<script setup>
import {ref} from 'vue'
// 用索引展示当前，定义属性
const props=defineProps({
  curIndex:{
    type:Number,
    default:0
  }
})
const list=[
{
    "pagePath": "/studens/return/jjiankang",
    "iconPath": "/static/image/noselectedjiankang.png",
    "selectedIconPath": "/static/image/selectedjiankang.png",
    "text": "健康填报"
    }, {
      "pagePath": "/studens/return/ziyuan",
      "iconPath": "/static/image/noselectedziyuan.png",
      "selectedIconPath": "/static/image/selectedziyuan.png",
      "text": "自愿返乡"
    },{
    "pagePath": "/studens/return/fanxiao",
    "iconPath": "/static/image/noselectedfanxiao.png",
    "selectedIconPath": "/static/image/selectedfanxiao.png",
    "text": "返校登记"
  },{
    "pagePath": "/studens/return/zhuce",
    "iconPath": "/static/image/noselectedzhuce.png",
    "selectedIconPath": "/static/image/selectedzhuce.png",
    "text": "到校注册"
  },{
    "pagePath": "/studens/return/geren",
    "iconPath": "/static/image/noselectedgeren.png",
    "selectedIconPath": "/static/image/selectedgeren.png",
    "text": "个人中心"
  }
]
const toTabbar=(path)=>{
  uni.navigateTo({
    url:path
  });
}
</script>

<template>
<view class="main2">
<view v-for="(item,index) in list" key="index" @click="toTabbar(item.pagePath)">
<!--  放图片-->
  <view style="text-align: center">
    <image v-if="index!=props.curIndex" class="img1" :src="item.iconPath"></image>
    <image v-else class="img1" :src="item.selectedIconPath"></image>
  </view>
<!--  放文字-->
  <view>{{item.text}}</view>
</view>
</view>
</template>
<style scoped>
.main2{
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-around;
  color: #393939;
  font-size: 10px;
  font-weight: 400;
  background-color: white;
  position: fixed;
  bottom: 0px;
}
.img1{
  width: 28px;
  height: 28px;
}
</style>